/**
 * 
 */
package com.google.code.sip.ucenter.model;

import java.util.LinkedHashSet;
import java.util.Set;

import com.google.code.morphia.annotations.Embedded;
import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Indexed;

/**
 * 积分规则实体类
 * 
 * @author Liuye
 * 
 */
@SuppressWarnings("serial")
@Entity(noClassnameStored = true)
public class CreditRule extends BaseEntity {
	/**
	 * 积分名称
	 */
	@Indexed(unique = true)
	private String name;
	/**
	 * 积分动作
	 */
	private String action;
	/**
	 * 周期类型：一次,每天,不限
	 */
	private CreditRuleCycleType cycleType;
	/**
	 * 间隔时间
	 */
	private String cycleTime;
	/**
	 * 奖励次数
	 */
	private Integer rewardNum;

	@Embedded
	private Set<CreditRuleAmount> creditRuleAmounts = new LinkedHashSet<CreditRuleAmount>();
	/**
	 * 显示顺序
	 */
	@Indexed()
	private Integer displayOrder;

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the action
	 */
	public String getAction() {
		return action;
	}

	/**
	 * @param action
	 *            the action to set
	 */
	public void setAction(String action) {
		this.action = action;
	}

	/**
	 * @return the cycleType
	 */
	public CreditRuleCycleType getCycleType() {
		return cycleType;
	}

	/**
	 * @param cycleType
	 *            the cycleType to set
	 */
	public void setCycleType(CreditRuleCycleType cycleType) {
		this.cycleType = cycleType;
	}

	/**
	 * @return the cycleTime
	 */
	public String getCycleTime() {
		return cycleTime;
	}

	/**
	 * @param cycleTime
	 *            the cycleTime to set
	 */
	public void setCycleTime(String cycleTime) {
		this.cycleTime = cycleTime;
	}

	/**
	 * @return the rewardNum
	 */
	public Integer getRewardNum() {
		return rewardNum;
	}

	/**
	 * @param rewardNum
	 *            the rewardNum to set
	 */
	public void setRewardNum(Integer rewardNum) {
		this.rewardNum = rewardNum;
	}

	public Set<CreditRuleAmount> getCreditRuleAmounts() {
		return creditRuleAmounts;
	}

	public void setCreditRuleAmounts(Set<CreditRuleAmount> creditRuleAmounts) {
		this.creditRuleAmounts = creditRuleAmounts;
	}

	public Integer getDisplayOrder() {
		return displayOrder;
	}

	public void setDisplayOrder(Integer displayOrder) {
		this.displayOrder = displayOrder;
	}
}
